class CreateUploads < ActiveRecord::Migration
  def self.up
    create_table :uploads do |t|
      t.column :group_id,    :integer,                  :null => false
      t.column :user_id,     :integer,                  :null => false
      t.column :deadline_id, :integer
      t.column :title,       :string,   :default => "", :null => false
      t.column :description, :text
      t.column :file_name,   :string,   :default => "", :null => false
      t.column :size,        :integer,  :default => 0,  :null => false
      t.column :path,        :string,   :default => "", :null => false
      t.column :final,       :integer,  :default => 0,  :null => false
      t.column :notes,       :text
      t.column :created_at,  :datetime,                 :null => false
    end
  end

  def self.down
    drop_table :uploads
  end
end
